package base.ifunction;

import java.util.function.Predicate;

public class TestPredicate {
    public static void main(String[] args) {
        testAnd();
    }

    private static void testPredicate() {
        Predicate<String> predicate = (String str) -> str.length() > 5;

        System.out.println(predicate.test("Hello World!"));
    }


    private static void testOr() {
        Predicate<String> predicate = (String str) -> str.length() > 20;
        Predicate<String> predicate1 = (String str) -> str.contains("d");

        System.out.println(predicate.or(predicate1).test("Hello World!"));

    }

    private static void testAnd() {
        Predicate<String> predicate = (String str) -> str.length() > 20;
        Predicate<String> predicate1 = (String str) -> str.contains("d");

        System.out.println(predicate.and(predicate1).test("Hello World!"));
    }
}
